package com.oocl.crm.service.impl;

import com.oocl.crm.command.Command;
import com.oocl.crm.command.impl.DeleteCommand;
import com.oocl.crm.exception.ParameterErrorException;
import com.oocl.crm.service.BusinessService;

/**
 * 删除业务处理
 * @author GANAB
 *
 */
public class DeleteBusinessService extends BusinessService{

	public String service(Command command) throws ParameterErrorException {
		DeleteCommand deleteCommand = (DeleteCommand) command;
		Integer userId = deleteCommand.getUserId();
		if(userId != null){
			if(this.getUserDB().remove(userId)){
				//删除成功，返回消息
				return "Delete user success! User Id is "+userId;
			}
		}
		return "No such user";
	}

}
